//
//  NSObject+OACellViewModelProtocol.m
//  OASDK_Works
//
//  Created by ChenJie on 5/23/20.
//  Copyright © 2020 Mist. All rights reserved.
//

#import "NSObject+OACellViewModelProtocol.h"
#import <objc/runtime.h>

@implementation NSObject (OACellViewModelProtocol)

/* Property: oa_layouts */
- (NSDictionary *)oa_layouts {
    NSDictionary *layouts = objc_getAssociatedObject(self, _cmd);
    if (!layouts) {
        layouts = @{};
        self.oa_layouts = layouts;
    }
    return layouts;
}

- (void)oa_setLayouts:(NSDictionary *)oa_layouts {
    objc_setAssociatedObject(self, @selector(oa_layouts), oa_layouts, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

/* Property: oa_executeActionWithEvent */
- (void (^)(id))oa_executeActionWithEvent {
    return objc_getAssociatedObject(self, _cmd);
}

- (void)oa_setExecuteActionWithEvent:(void (^)(id))oa_executeActionWithEvent {
    objc_setAssociatedObject(self, @selector(oa_executeActionWithEvent), oa_executeActionWithEvent, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

@end
